package chap09;

import java.io.IOException;
import java.net.MulticastSocket;
import java.net.ServerSocket;

public class EchoserverThread {
    public static void main(String [] args)throws IOException{
        ServerSocket serverSocket=null;
        boolean listening=true;
        try{
            serverSocket=new ServerSocket(1111);
        }catch (IOException e){
            System.err.println("Could not listen on port:1111");
            System.exit(1);
        }
        //
        while(listening)
        {
            new EchoMultiServerThread(serverSocket.accept()).start();
        }
        serverSocket.close();
    }
}
